﻿@model LoveEat.MODEL.shop_menu

@{

    ViewBag.Title = "菜品编辑";
    int i = 0;
}
@{
    Html.EnableClientValidation();
}
@using System.Web.Mvc.Html

<style type="text/css">

    #input1 {
        border: 1px solid #0000FF;
    }

    #btn1 {
        width: 70px;
        height: 21px;
        font-size: 12px;
        padding-top: 3px;
        background: url(83.gif) no-repeat;
        height: 22px;
        border: 0;
    }

  
</style>
<ul class="breadcrumb">
    <li>
        <i class="icon-home"></i>
        <a href="/">
            首页
        </a>
        <i class="icon-angle-right">
        </i>
    </li>
    <li>
    


        <a href="@Url.Action("ShopMenu", "MenuManagement")">
            菜品管理
        </a>
        <i class="icon-angle-right">
        </i>
    </li>
    <li>
        <a href="javascript:void(0)">
            菜品编辑
        </a>
    </li>
</ul>
<div class="row-fluid">
    <div class="span12">
        <div class="portlet box grey">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-credit-card"></i>
                    新增/编辑系列
                </div>
                <div class="tools">
                    <a href="javascript:;" class="collapse">
                    </a>
                </div>
                <div class="actions">
                    <a>
                    </a>
                </div>
            </div>
            <div class="portlet-body form">

                <form id="signupForm" action="@Request.Url.ToString()" method="post" enctype="multipart/form-data" onsubmit="Compare()" class="form-horizontal" novalidate="novalidate">
                    @Html.HiddenFor(model => model.status)
                    <div class="control-group">
                        <label class="control-label">
                            菜系分类
                            <span class="required">
                                *
                            </span>
                        </label>
                        <div class="controls">

                            @Html.DropDownListFor(model => model.series_id, ViewBag.seriesList as System.Web.Mvc.SelectList, "请选择系列", new { onChange = "on(this,'city_id')" })
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-group">
                            <label class="control-label">
                                菜品名称
                                <span class="required">
                                    *
                                </span>
                            </label>
                            <div class="controls">
                                @Html.TextBoxFor(model => model.menu_name)
                            </div>
                        </div>

                        <label class="control-label">
                            菜品图片
                            <span class="required">
                                *
                            </span>
                        </label>
                        <div class="controls">
                            @if (Model.menu_id > 0)
                            {
                                <img src="@Model.menu_icon" width="100" height="100" style=" border:1px solid #808080" />
                                <br />
                            }
                            @Html.TextBoxFor(model => model.menu_icon)
                            <input name="button" type="button" id="btn1" onclick="imageUpLoad.click();" value="浏览文档" />
                            <input type="file" id="imageUpLoad" name="imageUpLoad" onchange="menu_icon.value = this.value" style="display:none">

                        </div>
                    </div>
                 
                    <div class="control-group">
                        <label class="control-label">
                            菜品价格
                            <span class="required">

                            </span>
                        </label>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.price)
                        </div>
                    </div>

               
                    <div class="control-group">
                        <label class="control-label">
                            店铺
                            <span class="required">
                                *
                            </span>
                        </label>
                        <div class="controls">

                            @Html.DropDownListFor(model => model.shop_id, ViewBag.shopList as System.Web.Mvc.SelectList, "请选择店铺")
                          
                        </div>
                    </div>
           

                    <div class="form-actions">
                        <button type="submit" class="btn purple m-wrap">保存</button>
                        @*<a class="btn btn-default m-wrap" href="@Request.Url">返回</a>
                            <button type="button" class="btn btn-default" data-dismiss="modal" onclick="window.location.reload();">
                                取消*@
                      
                        <input type="hidden" name="hidStuatus" value="" />
                        <input type="hidden" name="returnUrl" value="@Request["returnUrl"]" />
                    </div>

                </form>
                <!-- END FORM-->
            </div>
        </div>
    </div>
</div>
<script charset="utf-8" src="~/Content/Scripts/plugins/Editor/kindeditor-min.js"></script>
<script charset="utf-8" src="~/Content/Scripts/plugins/Editor/zh_CN.js"></script>
<script type="text/javascript">
    $().ready(function () {
        $("#signupForm").validate({
            rules: {
                menu_name: "required",
                menu_icon: "required",
                price: {number:true,required:true},
                shop_id: { required: true },
                series_id: "required",
                shop_name: {
                    required: true
                },
                menu_type_id: {
                    required: true,

                }
            },
            messages: {
                menu_name: "请填写菜品名称",
                menu_icon: "请添加菜品图片",
                price: {required:"请输入价格",number:"请输入正确的价格"},
                phone: { required: "请输入手机号码", rangelength: "手机号码格式不正确" },
                series_id: "请选择系列",
                shop_id: {
                    required: "请选择店铺",

                }

            }
        });




    });
    //function doBan() {
    //    $("#sub").attr("disabled", "disabled");
    //}



</script>
